[alpaka] Template varius alpakatools classes on the Queue type#255
[alpaka] Template varius alpakatools classes on the Queue type#255fwyzard merged 6 commits intocms-patatrack:masterfrom
Conversation
366617e to
819deec
Compare
makortel
left a comment
There was a problem hiding this comment.
The "Simplify ScopedContextGetterBase::synchronizeStreams" commit looks good.
The "Template ScopedContext on the Queue type" commit looks generally good too, I left some comments that caught my eye that are related to the Product<T> and possibly were not caught by the compiler because that functionality is not used yet.
| auto getEvent(T_Acc acc) { | ||
| return getEventCache().get(acc); | ||
| } | ||
| auto getEvent() { return getEventCache<alpaka::Event<Queue>>().get(device()); } |
There was a problem hiding this comment.
Not about this PR, but I thought note since it caught my eye. I don't really understand what this function (in conjunction with the commented destructor body) should do. The ScopedContextProduce should store the std::shared_ptr<Event> (e.g. in its constructor), pass it to all Product<T>'s, and record the event ("enqueue to queue"?) in its destructor. Ok, doesn't really matter in practice at this stage where the Product<T> wrapper is not used yet.
There was a problem hiding this comment.
I have no idea... so far I've concentrated on cleaning things up, without breaking anything.
Understanding what is missing will come next...
| std::unique_ptr<Product<T>> wrap(T data) { | ||
| // make_unique doesn't work because of private constructor | ||
| return std::unique_ptr<Product<T>>(new Product<T>(device(), streamPtr(), getEvent(acc), std::move(data))); | ||
| return std::unique_ptr<Product<T>>(new Product<T>(streamPtr(), std::move(data))); |
There was a problem hiding this comment.
This should also pass the shared_ptr<Event>, but see my other comment #255 (comment).
9b16ff0 to
a6c56aa
Compare
Move the ContextState class and the ScopedContext class hierarchy outside of the ALPAKA_ACCELERATOR_NAMESPACE namespace, and template them on the Queue type used by the accelerator.
a6c56aa to
fdc589a
Compare
0f4ca09 to
df7c52a
Compare
|
About the "Fix the use of multiple devices in ESProduct" commit, the current model in |
|
Actually, multiple devices are still not supported, because all device memory operations operate on the first device. |
Move the ProductBase class and Product<T> class template outside of the ALPAKA_ACCELERATOR_NAMESPACE namespace, and template them on the Queue type used by the accelerator.
df7c52a to
992a608
Compare
…stead of always assuming the first one
Move the
ContextStateclass and theScopedContextclass hierarchy outside of theALPAKA_ACCELERATOR_NAMESPACEnamespace, and template them on theQueuetype used by the accelerator.Move the
ProductBaseclass andProduct<T>class template outside of theALPAKA_ACCELERATOR_NAMESPACEnamespace, and template them on theQueuetype used by the accelerator.